package Designpatterns.shizhan.broker;

import org.junit.Test;

public class ProxyTest {
    @Test
    public void test1(){
        BusinessService realService = new RealBusinessService();

        // 使用 JDK 动态代理
        BusinessService jdkProxy = JDKProxy.createProxy(realService);
        jdkProxy.performBusinessLogic();

        System.out.println("--------");

        // 使用 CGLIB 动态代理
        BusinessService cglibProxy = CGLIBProxy.createProxy(realService);
        cglibProxy.performBusinessLogic();
    }
}
